Algorithm-based diet